<template>
	<div class="add-jq-dialog">
		<!--操作日志-->
		
		
		<appdialog 
			ref="dialog"
			:visible="false" 
			title="日志"
			@confirm="confirmAdd"
			@cancle="cancleAdd"
			width="50%"
			>
		  <div
	      v-loading="loading"
	      style="background:#000;
	      height:330px;
	      display:block;
	      word-break:break-all;
	      word-wrap: break-word;
	      padding:5px;
	      color:#fff;
	      overflow-y: auto;
	      margin-left:4px;">
          <p  v-for="item in logList" :key="item.index">{{item}}</p>
      </div>
		</appdialog>
		
		
		
	</div>
</template>

<script>
import appdialog from "@/view/components/dialog/dialog";
import {searchLogByInstIdPage} from '@/service/swagger/LogController.js'

export default {
  name: "logDialog",
  props:[],
  components: {
    appdialog,
  },
  data() {
    return {
      loading:false,
      pageNum:1,
      pageSize:100,
      logList:[]
    };
  },
  mounted() {},
  methods: {
    open(id) {
      this.busy = false
      this.$refs.dialog.open();
      this.loading = true
      this.logList = []
      // 根据事件id查日志
			let params = {
				id:id,
				pageNum:this.pageNum,
				pageSize:this.pageSize,
			}
			searchLogByInstIdPage(params).then(ret=>{
      	this.loading = false
        if(ret&&ret.code == 0){
        	if(ret.data.data){
        		ret.data.data.forEach(el=>{
	            this.logList.push(JSON.parse(el).message)
	          })
        	}else{
        		this.logList.push("无")
        	}
				}
			})
    },
    close(){
      this.$refs.dialog.close();
    },

    confirmAdd() {
      this.close();
    },
    cancleAdd() {}
  }
};
</script>

<style scoped lang="scss">
@import "../../../styles/variables.scss";
span{
  
}
</style>